You are here: Statements and Functions > DTLeft()
Syntax samples
DTLEFT <time units>
Shift_Time = DTLeft()
The DTLEFT function returns the balance of the off-shift or break time remaining for a location or resource before it resumes normal activities. Unless passed as an argument (e.g., DTLeft(hr)), the return value uses the time units defined in the General Information Dialog (see General Information).
This function can only be referenced in off-shift and break logic (either the pre-start or main logic).
Components
<time units>
The time units, if different from the default found in the General Information dialog, in which you want the return value expressed.
Example
Suppose a technician is frequently working on a job when the end of the shift rolls around and that the priority for ending the shift is not high enough to interrupt the job. To ensure that the technician gets a minimum of 14 hours off before coming back to work, even though the shift file specified 16 hours between shifts, you could enter the following off-shift logic:
IF DTLEFT(hr) < 14 THEN
BEGIN
WAIT 14 hr
SKIP
END
Please note
In the above example, the SKIP statement is important to skip over the defined time in the shift file.
DTDELAY()